package com.hllxd.hism.star.basic.service.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lixiyong
 * @date 2022.06.12
 */
@Data
public class ZhibiaoDashboard {
    public Long id;
    public String dt;

    public static class ZhibiaoMetric {
        public String dt;
        /** dim default all ,dim tag  default all*/
        public String dim;
        public String tag;
        /** metric val */
        public String metric;
        public String content;
    }
    public List<ZhibiaoMetric> dapan;


    public static ZhibiaoMetric buildMetric(String dt, String dim, String tag, String metric,String content) {
        ZhibiaoMetric thiz = new ZhibiaoMetric();
        thiz.dt = dt;
        thiz.dim = dim;
        thiz.tag = tag;
        thiz.metric = metric;
        thiz.content = content;
        return thiz;
    }
    public void addMetric(ZhibiaoMetric item) {
        if(this.dapan==null) {
            this.dapan = new ArrayList<>();
        }
        this.dapan.add(item);
    }
    public void addMetric(String dt, String dim, String tag, String metric,String content) {
        if(this.dapan==null) {
            this.dapan = new ArrayList<>();
        }
        this.dapan.add(buildMetric(dt, dim, tag, metric, content));
    }
}
